package com.frame.work.common.constant;

public interface Const {

    String prefix = "smart.home.socket.server";
    /**
     * message type
     */
    int MESSAGE_TYPE_PUSH_FRAME_TO_PROCESS_LIST = 1;
    int MESSAGE_TYPE_WRITE_DATA_TO_GATEWAY = 2;
    int MESSAGE_TYPE_CONFIG_COMMAND_LIST = 3;


    // redis key
    interface RedisKey {
        String KEY_GATEWAY_FRAME_PROCESS_LIST = prefix + ".gateway.frame.process.list";
        String KEY_GATEWAY_DATA_PERSISTENCE_LIST = prefix + ".gateway.data.persistence.list";
        String KEY_GATEWAY_DATA_WRITE_LIST = prefix + ".gateway.data.write.list";
        String KEY_GATEWAY_DATA_WRITE_NOTIFY_CHANNEL = prefix + ".gateway.data.write.notify.channel";
        String KEY_SERVER_CONFIG_NOTIFY_CHANNEL = prefix + ".server.config.notify.channel";
        String KEY_CRON_TASK_EXECUTION_LIST = prefix + ".cron.task.execution.list";
    }

    // socket key
    interface SocketKey {
        String KEY_HEX_DATA = "smart-home-hex-data";
        String SOCKET_KEY_GATEWAY_MAC = "smart-home-gateway-mac";
        String SOCKET_KEY_SOCKET_KEY = "smart-home-socket-key";
        String SOCKET_KEY_PIPE_FROM = "smart-home-pipe-from";
        String SOCKET_KEY_LAST_ACTIVE_TIME = "smart-home-last-active-time";
        String SOCKET_KEY_REPORT_ONLINE = "smart-home-report-online";
        String SOCKET_KEY_REPORT_CONNECT = "smart-home-report-connect";
        String SOCKET_KEY_CONNECT_TIME = "smart-home-connect-time";
        String SOCKET_KEY_RESET_WIFI_COUNT = "smart-home-reset-wifi-count";
        String SOCKET_KEY_REQUEST_AUTH_COUNT = "smart-home-request-auth-count";
        String SOCKET_KEY_LOGIN_TIME = "smart-home-login-time";
    }

    //config命令
    interface Command {
        int CONFIG_COMMAND_START_DEBUG = 1;
        int CONFIG_COMMAND_STOP_DEBUG = 2;
    }

    /**
     * 数据持久性类型
     */
    interface DataPersistenceType {
        int DATA_PERSISTENCE_TYPE_CREATE_DEVICE_EVENT = 1;
        int DATA_PERSISTENCE_TYPE_CREATE_FRAME = 2;
        int DATA_PERSISTENCE_TYPE_CREATE_LOG = 3;
        int DATA_PERSISTENCE_TYPE_CREATE_OR_UPDATE_DEVICE = 4;
        int DATA_PERSISTENCE_TYPE_CREATE_STATISTICS = 5;
    }

    interface add {
        int DATA_PERSISTENCE_TYPE_CREATE_METERING_DEVICE_FRAME = 6;
        int DATA_PERSISTENCE_TYPE_CREATE_0FBE_FRAME = 7;
    }

    interface heartbeatOutDateInterval {
        int SOCKET_INACTIVE_INTERVAL = 60 * 11;
        int SOCKET_INACTIVE_INTERVAL_FINAL = 60 * 13;
        int SOCKET_INACTIVE_INTERVAL_REMOVE = 60 * 15;
        int SOCKET_INVALID_INTERVAL = 60 * 8;
    }

    interface SyncDeviceMinimalInterval {
        int SYNY_DEVICE_MINIMAL_INTERVAL = 60 * 5;
    }

    /**
     * 推送消息类型
     */
    interface MsgType {
        String MSG_ALL_TYPE = "0";
        String MSG_LOGINCODE_TYPE = "1";
        String MSG_ACCOUNT_TYPE = "2";
        String MSG_GENERAL_TYPE = "3";
        String MSG_WARNING_TYPE = "040401";
        String DEVICEORDINARY = "040402";//设备普通类推送消息
    }

    interface extrasCode {
        String EXTRAS_CODE_ALARM_DEVICE = "040401";
        /**
         * 入网
         */
        String IN_GATWAY = "030302";
    }

}
